Skip to content

Implemented the Disable state on swap button for max#174

Merged
AlAfiz merged 1 commit intoBETAIL-BOYS:mainfrom
KAMALDEEN333:Max-Splippage
Mar 30, 2026
Merged

Implemented the Disable state on swap button for max#174
AlAfiz merged 1 commit intoBETAIL-BOYS:mainfrom
KAMALDEEN333:Max-Splippage

Conversation

@KAMALDEEN333
Copy link
Copy Markdown
Contributor

Implemented the disabled state on Swap button for Max Slippage errors

Description
We previously created a modal for high slippage, but we also need visual feedback directly on the main button.
If the calculated slippage exceeds the user's hard maximum (e.g., > 50%), we shouldn't even let them click the button to see the modal.
The main CTA (Call to Action) button should turn gray, disable clicks, and change its text to explain the error.
This provides instant, localized feedback without requiring extra user clicks.

Requirements
Read the current estimated slippage and the user's max slippage setting.
If estimatedSlippage > maxSlippage, set the disabled prop on the component to true.
Change the button text from "Swap" to "Slippage Tolerance Exceeded".
Override the button's background color to a dull gray (bg-slate-700) and remove hover effects.

closes #84

Built a "Slippage Warning" Toast notification for auto-adjusted settings

Description
We previously built an "Auto Slippage" feature that dynamically adjusts the user's tolerance based on market conditions.
However, if the Auto mode shifts the slippage to a dangerously high number (e.g., > 3%) due to extreme volatility, the user might not notice.
We need to trigger a warning Toast notification whenever the Auto slippage calculates a value higher than 2.5%.
This ensures the user is actively informed that their trade is currently at high risk of being front-run.

Requirements
In the main Swap component, monitor the dynamically calculated autoSlippage state.
If autoSlippage exceeds 2.5%, use the global notification system to trigger a yellow warning toast.
The toast message should read: "Warning: Auto-slippage is currently high due to market volatility."
Ensure the toast only fires once per state change to prevent spamming the user's screen.

closes #104

@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 30, 2026

@KAMALDEEN333 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@AlAfiz AlAfiz merged commit 51a591d into BETAIL-BOYS:main Mar 30, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ux: Build a "Slippage Warning" Toast notification for auto-adjusted settings ui: Implement disabled state on Swap button for Max Slippage errors

2 participants